//package com.ship.dispatch.config;
//
//import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import org.springframework.web.server.WebFilter;
//import org.springframework.web.server.WebFilterChain;
//import reactor.core.publisher.Mono;
//
//@Component
//@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
//public class AppFilter implements WebFilter  {
//    @Override
//    public Mono<Void> filter( WebFilterChain chain) {
//        //设置当前请求
//        ReactiveHttpContextHolder.setReactiveContext(exchange);
//        return chain.filter(exchange).doFinally(signalType-> {
//            ReactiveHttpContextHolder.removeReactiveContext();
//            System.out.println("清空ReactiveHttpContextHolder");
//        });
//
////        return chain.filter(exchange)
////                .subscriberContext(context -> context.put(ReactiveHttpContextHolder.Info.CONTEXT_KEY, exchange));
//    }
//}
